home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / php / pear / HTML / Progress / observer.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  2.7 KB  |  78 lines

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP Version 4                                                        |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1997-2003 The PHP Group                                |
  6. // +----------------------------------------------------------------------+
  7. // | This source file is subject to version 3.0 of the PHP license,       |
  8. // | that is bundled with this package in the file LICENSE, and is        |
  9. // | available at through the world-wide-web at                           |
  10. // | http://www.php.net/license/3_0.txt.                                  |
  11. // | If you did not receive a copy of the PHP license and are unable to   |
  12. // | obtain it through the world-wide-web, please send a note to          |
  13. // | license@php.net so we can mail you a copy immediately.               |
  14. // +----------------------------------------------------------------------+
  15. // | Author: Laurent Laville <pear@laurent-laville.org>                   |
  16. // +----------------------------------------------------------------------+
  17. //
  18. // $Id: observer.php,v 1.1 2003/11/15 18:27:09 thesaur Exp $
  19.  
  20. /**
  21.  * The HTML_Progress_Observer implements the observer pattern
  22.  * for watching progress bar activity and taking actions
  23.  * on exceptional events.
  24.  *
  25.  * @version    1.0
  26.  * @author     Laurent Laville <pear@laurent-laville.org>
  27.  * @access     public
  28.  * @category   HTML
  29.  * @package    HTML_Progress
  30.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  31.  */
  32.  
  33. class HTML_Progress_Observer
  34. {
  35.     /**
  36.      * Instance-specific unique identification number.
  37.      *
  38.      * @var        integer
  39.      * @since      1.0
  40.      * @access     private
  41.      */
  42.     var $_id;
  43.  
  44.     /**
  45.      * Creates a new basic HTML_Progress_Observer instance.
  46.      *
  47.      * @since      1.0
  48.      * @access     public
  49.      */
  50.     function HTML_Progress_Observer()
  51.     {
  52.         $this->_id = md5(microtime());
  53.     }
  54.  
  55.     /**
  56.      * This is a stub method to make sure that HTML_Progress_Observer classes do
  57.      * something when they are notified of a message.  The default behavior
  58.      * is to just write into a file 'progress_observer.log' in current directory.
  59.      * You should override this method.
  60.      *
  61.      * Default events :
  62.      * - setMinimum
  63.      * - setMaximum
  64.      * - setValue
  65.      *
  66.      * @param      mixed     $event         A hash describing the progress event.
  67.      * @since      1.0
  68.      * @access     public
  69.      */
  70.     function notify($event)
  71.     {
  72.         $msg = (is_array($event)) ? serialize($event) : $event;
  73.         error_log ("$msg \n", 3, 'progress_observer.log');
  74.     }
  75. }
  76.  
  77. ?>
  78.